// vue.config.js


const webpack = require("webpack")

const path = require('path'); //引入path模块
function resolve(dir) {
	return path.join(__dirname, dir) //path.join(__dirname)设置绝对路径
}

module.exports = {
	// entry: {
	//     app: ["babel-polyfill", './src/main.js']
	// },
	// node: {
	//     fs: "empty"
	// },
	// resolve: {
	// 	alias: {
	// 		'vendor': path.resolve(__dirname, 'src/vendor'),
	// 	}
	// },

	// devServer: {
	// 	host: 'www.ytitsm.com',
	// 	port: 3000,
	// 	client: {
	// 		webSocketURL: 'ws://www.ytitsm.com/gd/connect',
	// 	},
	// 	headers: {
	// 		'Access-Control-Allow-Origin': '*',
	// 	}
	// },
	// requireModuleExtension: true,
	// transpileDependencies: true,
	productionSourceMap: false,
	// 关键是这一段===========>
	configureWebpack: {
		plugins: [
			new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
			new webpack.ProvidePlugin({
				$: "jquery",
				jQuery: "jquery",
				"windows.URL": "url",
				"windows.jQuery": "jquery",
				'window.Quill': 'quill/dist/quill.js',
				Quill: 'quill/dist/quill.js'
			})

		]
	},
	// entry:{
	//     app:["babel-polyfill","../src/main.js"],
	//   },

	//========================>
	publicPath: './',
	devServer: {
		host: 'localhost',
		port: 80,
		// client: {
		// 	webSocketURL: 'ws://www.ytitsm.com/gd/connect',
		// },
	},
	css: {
		loaderOptions: {
			less: {
				// 若 less-loader 版本小于 6.0，请移除 lessOptions 这一级，直接配置选项。
				lessOptions: {
					modifyVars: {
						// 直接覆盖变量
						'popup-round-border-radius': '8px',
					},
				},
			},
		},
	},
	chainWebpack: (config) => {
		config.resolve.alias
			.set('@', resolve('src'))
			.set('@assets', resolve('src/assets'))
			.set('@components', resolve('src/components'))
			.set('@views', resolve('src/views'))
			.set('@network', resolve('src/network'))
			.set('@constants', resolve('src/constants'))
		//set第一个参数：设置的别名，第二个参数：设置的路径　　　　
	},
	// 配置插件参数
};
